<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<!-- 1 .stop修饰符调用event.stopPropagation 阻止冒泡 -->
			<!-- <div @click="divclick">
				<button @click.stop="btnclick"></button>
			</div> -->
			<!-- 2 .prevent -->
			<form action="baidu" method="">
				<input type="submit" name="" id="" value="提交"@click.prevent="submitClick" />
			</form>
			<h2>当前计数:{{counter}}</h2>
			<button v-on:click="add()">+</button>
			<button v-on:click="sub()">-</button>
			<button type="button" @click="btn3Click(123,event)"></button>
		</div>
		
		<script type="text/javascript">
			const app = new Vue({
				el:'#app',
				data:{
					counter:0
				},
				methods:{
					add:function(){
						this.counter++
					},
					sub:function(){
						this.counter--
					},
					btn3Click:function(abc,event){
						console.log('0000000',123,event)
					},
					submitClick:function(){
						console.log('submitclick')
					}
				}
			})
		</script>
		
		
	</body>
</html>
